clear all
set maxvar 5000

*************************************
cd "/Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads"
log using "4_Log/115_Competition.log"

use "1_Data/AC_pre-delim_dataset.dta", clear

egen acstateid = concat(VD01_AC_id stateid),p("_")

gen bjptop3=0
replace bjptop3=1 if bjp_position_t0==2

gen inctop3=0
replace inctop3=1 if inc_position_t0==2

quietly areg change_incumbentvoteshare z2totalvill i.closeelec, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac1

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac2

quietly areg change_incumbentvoteshare z2totalvill i.closeelec i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac3

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec##i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac4

quietly areg changebjp c.z2totalvill if bjptop3==1 & (state=="madhya pradesh" | state=="rajasthan"), absorb(statedistrict2) cluster(acstateid)
quietly estimates store bjpac1
quietly estadd ysumm, me

quietly areg changebjp c.z2totalvill if bjptop3==1 & BJPvINC==1 & BJPmajorgovt==0, absorb(statedistrict2) cluster(acstateid)
quietly estimates store bjpac2
quietly estadd ysumm, me


****************************************

use "1_Data/AC_post-delim_dataset.dta", clear

egen acstateid = concat(VD01_AC_id stateid),p("_")

gen bjptop3=0
replace bjptop3=1 if bjp_position_t2==2

gen inctop3=0
replace inctop3=1 if inc_position_t2==2

quietly areg change_incumbentvoteshare z2totalvill i.closeelec, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac5

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac6

quietly areg change_incumbentvoteshare z2totalvill i.closeelec i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac7

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec##i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store ac8

quietly areg changebjp c.z2totalvill if bjptop3==1 & (state=="maharashtra" | state=="rajasthan"), absorb(statedistrict2) cluster(acstateid)
quietly estimates store bjpac3
quietly estadd ysumm, me

quietly areg changebjp c.z2totalvill if bjptop3==1 & BJPvINC==1 & BJPmajorgovt==0, absorb(statedistrict2) cluster(acstateid)
quietly estimates store bjpac4
quietly estadd ysumm, me

*******************

esttab ac* using "2_Tables/Appendix_Table_G5_1.doc", replace rtf nobase noomit cells(b(star fmt(3)) se(par fmt(3))) collabels(none) nomtitles mgroups("Pre-delimitation ACs" "Post-delimitation ACs", pattern(1 0 0 0 1 0 0 0)) varlabels(z2totalvill "Δ connectivity" 1.closeelection "Close elections" 1.closeelection#c.z2totalvill "Close elections × Δ connectivity" 1.rulingparty "Ruling party" 1.rulingparty#c.z2totalvill "Ruling party × Δ connectivity" 1.closeelection#1.rulingparty "Close × Ruling party" 1.closeelection#1.rulingparty#c.z2totalvill "Close × Ruling × Δ connectivity") drop(_cons) title("The effect of roads provision in competitive races on incumbent support in state elections") addnote("\i{Notes:}\i0 The dependent variable is change in the state-level incumbent party/ coalition vote share in consecutive state-level elections, measured in %. Each model contains a district fixed effect and a constant that is not reported. Standard errors are clustered to the district level. *** p<0.001, ** p<0.01, * p<0.05") substitute("\fs20" "\fs16" "\fs24" "\fs16") varwidth(18) modelwidth(4 3 3 3 4 3 3 3)


******************

esttab bjpac* using "2_Tables/Appendix_Table_G5_3.doc", replace rtf nobase noomit cells(b(star fmt(3)) se(par fmt(3))) collabels(none) nomtitles mgroups("Pre-delimitation" "Post-delimitation", pattern(1 0 1 0)) varlabels(z2totalvill "Δ connectivity") keep(z2totalvill) title("The effect of roads on Δ BJP's voteshare when BJP candidates are main challengers in the baseline election: State constituencies") addnote("\i{Notes:}\i0 For (1) & (3), the sample refers to those constituencies where a BJP candidate occupies second position in previous election, the BJP is not the ruling party at the state level, and the electoral competition is between BJP and INC at the state level. For (2) & (4), the sample refers to those constituencies where a BJP candidate occupies second position in previous election, the BJP is not the ruling party at the state level, and the electoral competition is between BJP and INC at the constituency level, that is, the incumbent is from the INC. The mean Δ BJP voteshare also refers to the respective sample. Each model contains a district fixed effect and a constant that is not reported. Standard errors are clustered to the constituency-level. *** p<0.001, ** p<0.01, * p<0.05") scalars("ymean Mean Δ BJP voteshare") sfmt("%9.3f") obslast varwidth(20) modelwidth(12 6 12 6)



**********************************************************************************************

use "1_Data/PC_pre-delim_dataset_select.dta", clear

egen pcstate = concat(PC_no_2001 stateid),p("_")

gen bjpchallenger= 0
replace bjpchallenger= 1 if party_2=="BJP"

quietly areg change_incumbentvoteshare z2totalvill i.closeelec, absorb(state2) cluster(pcstate)
quietly estimates store pc1

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec, absorb(state2) cluster(pcstate)
quietly estimates store pc2

quietly areg change_incumbentvoteshare z2totalvill i.closeelec i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pc3

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec##i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pc4

quietly areg changebjp c.z2totalvill##i.bjpchallenger, absorb(state2) cluster(pcstate)
quietly estimates store bjppc1
egen bjpmean = mean(changebjp) if bjpchallenger==1
quietly estadd scalar meany = bjpmean[316]


****************************************************

use "1_Data/PC_post-delim_dataset_select.dta", clear

egen pcstate = concat(PC_no_2001 stateid),p("_")

gen bjpchallenger= 0
replace bjpchallenger= 1 if party_2=="BJP"

quietly areg change_incumbentvoteshare z2totalvill i.closeelec, absorb(state2) cluster(pcstate)
quietly estimates store pc5

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec, absorb(state2) cluster(pcstate)
quietly estimates store pc6

quietly areg change_incumbentvoteshare z2totalvill i.closeelec i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pc7

quietly areg change_incumbentvoteshare c.z2totalvill##i.closeelec##i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pc8

quietly areg changebjp c.z2totalvill##i.bjpchallenger, absorb(state2) cluster(pcstate)
quietly estimates store bjppc2
egen bjpmean = mean(changebjp) if bjpchallenger==1
quietly estadd scalar meany = bjpmean[227]



************************

esttab pc* using "2_Tables/Appendix_Table_G5_2.doc", replace rtf nobase noomit cells(b(star fmt(3)) se(par fmt(3))) collabels(none) nomtitles mgroups("Pre-delimitation PCs" "Post-delimitation PCs", pattern(1 0 0 0 1 0 0 0)) varlabels(z2totalvill "Δ connectivity" 1.closeelection "Close elections" 1.closeelection#c.z2totalvill "Close elections × Δ connectivity" 1.rulingparty "Ruling party" 1.rulingparty#c.z2totalvill "Ruling party × Δ connectivity" 1.closeelection#1.rulingparty "Close × Ruling party" 1.closeelection#1.rulingparty#c.z2totalvill "Close × Ruling × Δ connectivity") drop(_cons) title("The effect of roads provision in competitive races on incumbent support in national elections") addnote("\i{Notes:}\i0 The dependent variable is change in the national level incumbent party/ coalition vote share in consecutive national level elections, measured in %. Each of the predictors seen in the table is standardized. Each model contains a state fixed effect and a constant that is not reported. Standard errors are clustered to the state-level. *** p<0.001, ** p<0.01, * p<0.05") substitute("\fs20" "\fs16" "\fs24" "\fs16") varwidth(18) modelwidth(4 3 3 3 4 3 3 3)


************************

esttab bjppc* using "2_Tables/Appendix_Table_G5_4.doc", replace rtf nobase noomit cells(b(star fmt(3)) se(par fmt(3))) collabels(none) mtitles("Pre-delimitation" "Post-delimitation") varlabels(z2totalvill "Δ connectivity" 1.bjpchallenger "BJP challenger" 1.bjpchallenger#c.z2totalvill "BJP challenger × Δ connectivity") drop(_cons) title("The effect of roads on Δ BJP's voteshare when BJP candidates are main challengers in the baseline election: National constituencies") addnote("\i{Notes:}\i0 Each model contains a state fixed effect and a constant that is not reported. Standard errors are clustered to the constituency-level. *** p<0.001, ** p<0.01, * p<0.05") scalars("meany Mean Δ BJP voteshare (Challenger constituencies)") sfmt("%9.3f") obslast varwidth(24) substitute("\fs20" "\fs16" "\fs24" "\fs20")


***************************************************************************************


use "1_Data/upboothdataset_1km.dta", clear

quietly areg b_chgincvoteshare i.boothtreated2012 if acwinner_sp==1, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up1
quietly estadd local sp "SP constituencies"

quietly areg changebjp i.boothtreated2012 if acwinner_bjp==1, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up2
quietly estadd local sp "BJP constituencies"

quietly areg b_chgincvoteshare i.boothtreated2012##c.z2newspap, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up3
quietly estadd local sp "Full"

quietly areg b_chgincvoteshare i.boothtreated2012##c.z2commfac, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up4
quietly estadd local sp "Full"

quietly areg b_chgincvoteshare i.boothtreated2012##c.z2eduaccess, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up5
quietly estadd local sp "Full"

quietly areg b_chgincvoteshare i.boothtreated2012 if closeelection==1, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up6
quietly estadd local sp "Close- elections"

quietly areg b_chgincvoteshare i.boothtreated2012 if closeelection==1 & acwinner_sp==1, absorb(ac_id_09) cluster(ac_id_09)
quietly estimates store up7
quietly estadd local sp "Close-elections & SP constituencies"


*****************

esttab up* using "2_Tables/Appendix_Table_G6.doc", replace rtf nobase noomit cells(b(star fmt(3)) se(par fmt(3))) collabels(none) mtitles("SP voteshare" "BJP voteshare" "SP voteshare" "SP voteshare" "SP voteshare" "SP voteshare" "SP voteshare") varlabels(1.boothtreated2012 "PMGSY road" z2newspap "Media availability (std.)" 1.boothtreated2012#c.z2newspap "PMGSY road × Media availability (std.)" z2commfac "Comm. facility (std.)" 1.boothtreated2012#c.z2commfac "PMGSY road × Comm. facility (std.)" z2eduaccess "Edu. facility (std.)" 1.boothtreated2012#c.z2eduaccess "PMGSY road × Edu. facility (std.)") drop(_cons) title("UP: Information rich environment and competitiveness") addnote("\i{Notes:}\i0 Standard errors are clustered to the state-level. *** p<0.001, ** p<0.01, * p<0.05") varwidth(22) substitute("\fs20" "\fs16" "\fs24" "\fs16") modelwidth(5 5 3 3 3 3 7) scalars("sp Sample")


log close
